import fetch from '@/utils/fetch'

export function save(query) {
  return fetch({
    url: '/appGroup/save',
    method: 'POST',
    params: query
  })
}

export function queryById(id) {
  return fetch({
    url: '/appGroup/queryById?id=' + id,
    method: 'GET'
  })
}

export function queryRelatById(id) {
  return fetch({
    url: '/appGroup/queryRelatById?id=' + id,
    method: 'GET'
  })
}

export function check(query) {
  return fetch({
    url: '/appGroup/check',
    method: 'GET',
    params: query
  })
}

export function getGroup() {
  return fetch({
    url: '/appGroup/getGroup',
    method: 'GET'
  })
}

export function queryAllApps(query) {
  return fetch({
    url: '/appGroup/all',
    method: 'GET',
    params: query
  })
}

export function queryAppGroups(query) {
  return fetch({
    url: '/appGroup/queryAppGroups',
    method: 'GET',
    params: query
  })
}

export function updateAlarmStatus(query) {
  return fetch({
    url: '/appGroup/updateAlarmStatus',
    method: 'POST',
    params: query
  })
}

export function update(query) {
  return fetch({
    url: '/appGroup/update',
    method: 'POST',
    params: query
  })
}

export function deleteById(id) {
  return fetch({
    url: '/appGroup/deleteById?id=' + id,
    method: 'GET'
  })
}

export function queryUsers(query) {
  return fetch({
    url: '/sys/user/queryUsers',
    method: 'GET',
    params: query
  })
}

export function queryInstances(query) {
  return fetch({
    url: '/instanceInfo/queryInstances',
    method: 'GET',
    params: query
  })
}

export function queryAllTypeList(query) {
  return fetch({
    url: '/instanceType/queryAllTypeList',
    method: 'GET',
    params: query
  })
}
